package stuff;

import java.util.ArrayList;
import java.util.List;

import model.Appointment;

/**
 * This class represents a day and holds all of the appointments that occur on
 * that day. The appointments are stored in a arraylist.
 * 
 * @author Matthew Edwards
 * @version 3-5-11
 */
public class AppointmentDay {
    
	private int day;
	
    private final List<Appointment> appointments;

	/**
	 * This constructor creates a new day that holds appointments.
	 * 
	 * @param day
	 *            The day of the month created as an int, example would be 10
	 *            would be the tenth day of the month.
	 */
    public AppointmentDay(int day){
    	this.day = day;
    	appointments = new ArrayList<Appointment>();
    }

	/**
	 * Adds an appointment to a day of the month.
	 * 
	 * @param appointment
	 *            The appointment of type Appointment to be added to the
	 *            arraylist of appointments.
	 */
    public void addAppointment(Appointment appointment){
    	appointments.add(appointment);
    }

	/**
	 * This getter gets the ArrayList of appointments and returns it as a type
	 * of arraylist of appointments.
	 * 
	 * @return The ArrayList of appointments for use by other classes.
	 */
    public List<Appointment> getAppointments(){
    	return appointments;
    }
    
    /**
     * This setter sets the day of the appointment as a type int.
     * 
     * @param day The day of the month to be set as an int. 
     */
    public void setDay(int day){
    	this.day = day;
    }
    
    /**
     * This getter returns the day of the month or appointment as a type int. 
     * 
     * @return The day of the month as an int. 
     */
    public int getDay(){
    	return day;
    }
    
}